<% layout('/layouts/default.html', {title: '考核任务通知表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<#form:form id="searchForm" model="${dcSupExamNotice}" action="${ctx}/notice/dcSupExamNotice/listData?noticeType=4" method="post" class="form-inline "
			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			<div style="float: right">
<!--				<div class="form-group">-->
<!--					<label class="control-label">${text('年度')}：</label>-->
<!--					<div class="control-inline width-120">-->
<!--						<#form:select path="examYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" defaultValue="${currentYear}"/>-->
<!--					</div>-->
<!--				</div>-->
				<div class="form-group">
					<label class="control-label">${text('通知标题')}：</label>
					<div class="control-inline width-160">
						<#form:input path="noticeTitle" maxlength="100" class="form-control width-160" placeholder="请输入通知标题"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</div>
		</#form:form>
	</div>
	<div class="box-body">
		<table id="dataGrid"></table>
		<div id="dataGridPage"></div>
	</div>
</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	showRownum: false,
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("id")}',hidden: true, name:'id',width:150, align:"left", frozen:true},
		{header:'${text("考核任务id")}', name:'examId', index:'a.exam_id',hidden:true},
		{header:'${text("考核年度")}', name:'examYear', index:'a.exam_year', width:50, align:"center"},
		{header:'${text("考核标题")}', name:'examTitle',  width:150, align:"left"},
		{header:'${text("通知标题")}', name:'noticeTitle', index:'a.notice_title', width:150, align:"left"
			, formatter: function(val, obj, row, act){
				var a ="${ctx}/notice/dcSupExamNotice/form?examId="+row.examId+"&examYear="+row.examYear+"&noticeType="+row.noticeType
				return '<a class="btnList" href="'+a+'"> '+val+' </a>'
			}},
		{header:'${text("通知内容")}', name:'noticeContent', index:'a.notice_content', width:150, align:"left"},
		{header:'${text("报送单位")}', name:'noticeOrgNames', width:70, align:"left",hidden: true},
		{header:'${text("报送时限")}', name:'noticeEndTime', index:'a.notice_end_time', width:100, align:"center"},
		{header:'${text("通知类型")}', name:'noticeType', index:'a.notice_type', width:70, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('dc_notice_type')}, val, '${text("未知")}', true);
		}},
		// {header:'${text("附件")}', name:'fileName',width:110, align:"left", formatter: function(val, obj, row, act){
		// 	if(row.fileName){
		//
		// 		var fileId ='/whdc/a/file/download/'+row.fileId
		// 	  return '<a class=" blue" target="_blank" href="'+fileId+'"><i class="fa fa-download"></i> '+row.fileName+' </a>'}else{
		//
		// 	  return '无'
		// 	}
		// 	}},
		{header:'${text("状态")}', name:'noticeStatus' , width:50, align:"center",hidden: true
			, formatter: function(val, obj, row, act){
				return js.getDictLabel(${@DictUtils.getDictListJson('dc_notice_status')}, val, '${text("未知")}', true);
			}},
		{header:'${text("操作")}', name:'actions', width:230, align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			if(row.noticeStatus=='1') {
				actions.push('<a href="${ctx}/notice/dcSupExamNotice/receiveNotice?id=' + row.noticeOrgId +'&noticeType='+row.noticeType+'&noticeId='+row.id +'&examId='+row.examId +'&noticeStatus=2&noticeOrg='+row.noticeOrgs+'"  class="btn btn-primary btn-xs btnList" title="${text("接收")}" data-confirm="${text("确认要接收该通知吗？")}">接收</a>&nbsp;');
			}else{
				actions.push('<a href="${ctx}/score/dcSupExamDXZBScore/view?&examId=' + row.examId + '&gradeOrg='+row.noticeOrgs+'&noticeId='+row.id +'" class="btn btn-primary btn-xs btnList" title="${text("单项指标评分")}"><span>单项指标评分</span></a>&emsp;');
			}
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});

function cz(){
	searchForm.reset();
	$('#dataGrid').dataGrid('reloadGrid');
}
</script>